#ifndef COMPONENT_CHECK_H
#define COMPONENT_CHECK_H

#include <pcl/io/pcd_io.h>
#include <pcl/common/transforms.h>
#include <pcl/common/angles.h>
#include "component.h"
#include "math.h"
#include "registration.h"

/*!
 \file componentCheck.h This file contains the component check functions.
 \author Sqizzato Stefano
 \author Maroso Alessandro

*/

using namespace std;
using namespace pcl;

/*!
 \brief Checks whether the presence test is correct.

 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool presenceCorrect(Component source, Component target, float threshold);

/*!
 \brief Checks whether the position test is correct.


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] transformation The input 4x4 transformation matrix that registers the source component on the target component.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool positionCorrect(Component source, Component target, Eigen::Matrix4f transformation, float threshold);

/*!
 \brief Checks whether the inclination test is correct.


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] transformation The input 4x4 transformation matrix that registers the source component on the target component.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool inclinationCorrect(Component source, Component target, Eigen::Matrix4f transformation, float threshold);

/*!
 \brief Checks whether the orientation test is correct.


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] transformation The input 4x4 transformation matrix that registers the source component on the target component.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool orientationCorrect(Component source, Component target, Eigen::Matrix4f transformation, float threshold);

/*!
 \brief Checks whether the color test is correct


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool colorCorrect(Component source, Component target, float threshold);

/*!
 \brief Checks whether the radius test is correct


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool radiusCorrect(Component source, Component target, float threshold);

/*!
 \brief Checks whether the height test is correct


 \param[in] source The source component to test.
 \param[in] target The reference component in the target cloud.
 \param[in] threshold The threshold discriminating between success and failure.
 \return bool True whether the test is successful.
*/
bool heightCorrect(Component source, Component target, float threshold);
#endif // COMPONENT_CHECK_H
